import { read } from '../../storage'
const state = {
  power: read('power') || `{
    "actionTree": [],
    "orgs": [],
    "showActions": []
  }`
}

const getters = {
  ACTIONTREE(_, getters) {  // 标签树
    return []
  },

  ORGS(_, getters) {
    return getters.POWER.orgs
  },

  ACTIONS(_, getters) { // 以标签tag为属性名的对象
    const actions = {}
    // getters.POWER.showActions.forEach(item => { actions[item.tag] = item })
    return actions
  }

}

const mutations = {
}

const actions = {
}

export default {
  state,
  mutations,
  actions,
  getters
}
